package com.dg.cuckoo.admin.action.basicInformation.label;

import com.dg.cuckoo.admin.service.WarrantLabelService;
import com.dg.cuckoo.common.utils.PageModel;
import com.dg.cuckoo.core.BaseController;
import com.dg.cuckoo.core.JsonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;


/**
 * 基础资料-标签管理-标签授权
 */
@RestController
@RequestMapping("/basicInformation/label/warrantLabel")
public class WarrantLabel extends BaseController {
    @Autowired
    private WarrantLabelService warrantLabelService;


    /**
     * 页面显示
     */
    @PostMapping("select")
    public JsonResult<String> select(){
        String data = warrantLabelService.select();
        return new JsonResult<>(OK,data);
    }

    /**
     * 点击标签显示list名称
     * @param id 标签id主键
     * @return
     */
    @PostMapping("openInfo/{id}")
    public JsonResult<List<String>> openInfo(@PathVariable String id){
        List<String> data = warrantLabelService.openInfo(id);
        return new JsonResult<>(OK,data);
    }

}
